fix: specs correctness and comprehensive test coverage#12
Draft
Koan-Bot wants to merge 3 commits into
Draft
Conversation
The ports query filter spec listed 'prokect_id' instead of 'project_id', preventing server-side filtering by project ID from working. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The delete section defined a 'delete_server_from_uid' method using 'getfromid' type, which generates a GET request — not a DELETE. This method was also unreachable through Routes (not registered in the route table), making it dead code that would behave incorrectly if ever wired up. The actual delete_server method in Compute.pm handles deletion with proper floating IP cleanup and is the correct implementation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 41 tests covering previously untested functionality: - Listable regex filtering (single match, multi match, no match) - Multi-criteria filtering with AND semantics - Filtering resilience when fields are missing on candidates - getfromid single-key response unwrapping behavior - getfromid multi-key response passthrough - Specs query_filters_for validation (valid, invalid, mixed keys) - query_filters_for edge cases (odd args, empty, unknown routes) - Network service server-side query filter propagation - Routes::list_all() coverage - Error handling in query_filters_for Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix two bugs in API specs and add 41 tests for previously untested core functionality.
Why
prokect_idtypo in Network specs silently broke server-side filtering by project IDdeletesection usinggetfromidtype, generating a GET method for what should be a DELETE — dead code that would misbehave if ever wired upHow
prokect_id→project_idin Network v2 specsdelete_serverin Compute.pm handles deletion correctly with floating IP cleanup)t/specs-and-filtering.twith 41 tests covering: regex/multi-criteria/empty filtering, getfromid response unwrapping, query_filters_for validation, Routes dispatch, and error handlingTesting
Full test suite passes: 7 files, 64 tests (was 23 before this PR).
🤖 Generated with Claude Code
Quality Report
Changes: 3 files changed, 415 insertions(+), 11 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline